package perf.data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


public class Setup extends BaseItem<Run,Object> {
	private String command;
	private List<String> costs = new ArrayList<String>();
	
	public Setup(String name) {
		super( name );
	}
	
	@Override
	public long getCost(int costidx) {
		return 0;
	}
	
	public void addCostIndex( String costname ) {
		costs.add( costname );
	}
	
	public int getCostIndex( String name ) {
		return costs.indexOf( name );
	}
	
	public void setCommand( String command ) {
		this.command = command;
	}
	
	public String getCommand( ) {
		return command;
	}

	public Run getRunInstance( String name ) {
		Run r = findSibling( name );
		if ( r != null ) {
			return r;
		} else {
			return new Run( new Date() );
		}
	}
	
	@Override
	public String toString() {
		return getName();
	}
}
